<?php

//Route::middleware('auth:api')->get('/user/{method}','ProfileController@user');
Route::middleware('auth:api')->get('/user/',function(){
    return request()->user();
});

Route::get('/posts','PostsController@index');
Route::get('/posts/{post}','PostsController@show');

Route::post('/register','Auth\RegisterController@register');   //用户注册

Route::post('/sendcode','Auth\RegisterController@sendcode');    //发送验证码
//Route::middleware('throttle:5')->post('/login','Auth\LoginController@login');  //用户登录
Route::post('/login','Auth\LoginController@login');  //用户登录
Route::post('/logout','Auth\LoginController@logout'); //用户退出
Route::post('/token/refresh','Auth\LoginController@refresh');   //刷新token
Route::post('password/reset-phone', 'Auth\PasswordController@resetByPhone');

//忘记密码
Route::post('/repass','Auth\PasswordController@repass');

//api登录中间件
Route::middleware('auth:api')->group(function () {
    Route::post('/user/profile/update','ProfileController@update');
    Route::post('/user/password/update','Auth\PasswordController@update');

    //上传
    Route::prefix('data')->group(function() {
        Route::post('/uploadsave','DataController@store');
    });

    //收藏
    Route::get('/collect/{type}/{id}','CollecController@collect');

    //模型下载
    Route::get('/downdata/{id}','DownController@downdata');
    //案例下载
    Route::get('/downarticle/{id}','DownController@downarticle');

    //用户通知
    Route::get('/notifications','NotifyController@notify');
    //用户通知标志已读
    Route::get('/notifications/{notification}','NotifyController@notifyread');
    //用户通知删除
//    Route::post('/notifications','NotifyController@notify');

    //用户信息
    Route::get('/userinfo/{method}','ProfileController@userinfo');
    //修改密码
    Route::post('/update','Auth\PasswordController@update');
    //修改用户信息
    Route::post('/updateinfo','ProfileController@updateinfo');
    //三方登录绑定
    Route::get('/threebind/{hashtoken}','ProfileController@threebind');
    //三方登录解绑
    Route::get('/threeunbind/{type}','ProfileController@threeunbind');
    //用户的收藏
    Route::get('/usercollects/{type}/{method}','ProfileController@usercollects');
    //用户的上传
    Route::get('/useruploads/{type}/{method}','ProfileController@useruploads');
    //用户的上传
    Route::get('/modeldelete/{id}','ProfileController@usermodeldel');
    //用户不通过模型删除
    Route::get('/userdowns/{type}/{method}','ProfileController@userdowns');
    //用户的提现
    Route::get('/tixian/{method}/{model}','TixianController@tixian');
    //验证提现账号验证码
    Route::post('/tixiancode','TixianController@codevalidate');
    //绑定提现支付宝号
    Route::post('/tixianaccount','TixianController@alipay_account');
    //申请提现
    Route::post('/shenqingtixian','TixianController@shenqingtixian');
    //支付
    Route::post('/pay','PayController@pay');

    //vip时间处理
    Route::get('/viptime/{time}','AppController@viptime');

    //邀请链接唯一识别码
    Route::get('/onlycode','ShareController@onlycode');
});
//邀请人信息
Route::get('/shareUser/{code}','ShareController@shareUser');
//微信分享
Route::get('/wxshare/{code}','ShareController@wxshare');

//支付renturn_url
Route::get('/pay/wxpayreturn/{order}','PayController@wxreturn');
//支付宝回掉
Route::post('/pay/notify','PayController@notify');
//微信回掉
Route::post('/pay/wxnotify','PayController@wxnotify');

//模型案例直接下载地址
Route::get('/downurl/{user_id}/{type}/{id}/{passkey}','DownController@downurl');
//获取分类
Route::get('/data/create/{type}','DataController@create');
//首页数据
Route::get('/index/{method}','IndexController@index');
//每周推荐
Route::get('/weekWelfare','IndexController@weekWelfare');
//vip活动数据
Route::get('/vipdata/{method}','IndexController@vipdata');
//分类列表页数据
Route::get('/cat/{type}/{catid1}/{catid2}/{style}/{id}/{keys}/{sort}/{vip}/{method}','DataController@show');
//用户数据列表
Route::get('/usershow/{user_id}/{type}/{method}','DataController@usershow');
//模型详情数据
Route::get('/info/{id}/{method}','DataController@index');
//模型详情数据
Route::get('/nearby/{type}/{cat_id2}/{id}/{method}','DataController@nearby');
//案例数据
Route::get('/article/{id}/{method}','DataController@article');
//下载示例模型
Route::get('/downdemo','IndexController@downdemo');
//下载贴图
Route::get('/downmap','DownController@downmap');

//Route::get('/ceshi','IndexController@ceshi');
//Route::get('/wxpay','PayController@wxpay');
//Route::get('/img','DataController@img');


Route::get('/threelogin/{type}','Auth\LoginController@threelogin');
Route::post('/threeregister','Auth\RegisterController@threeregister');
Route::get('/threeredirect/{type}','Auth\LoginController@threeredirect');
Route::get('/threecallback/{hashtoken}','Auth\LoginController@threecallback');


Route::get('/applist/{catid}/{method}','AppController@applist');
Route::get('/appinfo/{id}/{method}','AppController@appinfo');
